import { OrderStatus } from '@/types/order';

export const getOrderStatus = (status: OrderStatus) => {
  const map: Record<OrderStatus, { text: string; type: 'success' | 'primary' | 'warning' | 'error' | 'info' }> = {
    [OrderStatus.Pending]: { text: '待处理', type: 'warning' },
    [OrderStatus.Confirmed]: { text: '已确认', type: 'primary' },
    [OrderStatus.Completed]: { text: '已完成', type: 'success' },
    [OrderStatus.Cancelled]: { text: '已取消', type: 'error' },
    [OrderStatus.Rescheduled]: { text: '已改签', type: 'info' },
  };
  return map[status] || { text: '未知', type: 'info' };
};